package com.ruoyi.system.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PurStockmanageMapper;
import com.ruoyi.system.domain.PurStockmanage;
import com.ruoyi.system.service.IPurStockmanageService;

/**
 * stockService业务层处理
 * 
 * @author bhl
 * @date 2022-04-09
 */
@Service
public class PurStockmanageServiceImpl implements IPurStockmanageService 
{
    @Autowired
    private PurStockmanageMapper purStockmanageMapper;

    /**
     * 查询stock
     * 
     * @param id stock主键
     * @return stock
     */
    @Override
    public List<Map> selectPurStockmanageById(Integer id)
    {
        return purStockmanageMapper.selectPurStockmanageById(id);
    }

    /**
     * 查询stock列表
     * 
     * @param purStockmanage stock
     * @return stock
     */
    @Override
    public List<Map> selectPurStockmanageList(PurStockmanage purStockmanage)
    {
        return purStockmanageMapper.selectPurStockmanageList(purStockmanage);
    }

    /**
     * 新增stock
     * 
     * @param purStockmanage stock
     * @return 结果
     */
    @Override
    public int insertPurStockmanage(PurStockmanage purStockmanage)
    {
        purStockmanage.setCreateTime(DateUtils.getNowDate());
        return purStockmanageMapper.insertPurStockmanage(purStockmanage);
    }

    /**
     * 修改stock
     * 
     * @param purStockmanage stock
     * @return 结果
     */
    @Override
    public int updatePurStockmanage(PurStockmanage purStockmanage)
    {
        purStockmanage.setUpdateTime(DateUtils.getNowDate());
        return purStockmanageMapper.updatePurStockmanage(purStockmanage);
    }

    /**
     * 批量删除stock
     * 
     * @param ids 需要删除的stock主键
     * @return 结果
     */
    @Override
    public int deletePurStockmanageByIds(Integer[] ids)
    {
        return purStockmanageMapper.deletePurStockmanageByIds(ids);
    }

    /**
     * 删除stock信息
     * 
     * @param id stock主键
     * @return 结果
     */
    @Override
    public int deletePurStockmanageById(Integer id)
    {
        return purStockmanageMapper.deletePurStockmanageById(id);
    }
}
